﻿using Core.Cache.Memory;
using Core.Cache.Redis;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Cache
{
   public static class ConfigureCache
    {
       public static void AddCache(this IServiceCollection services)
        {
            services.AddSingleton<IRedisClient, RedisClient>();
            services.AddSingleton<IMemoryCacheClient, MemoryCacheClient>();
            services.AddSingleton<IMemoryCache, MemoryCache>();
            services.AddScoped<ICacheFactory, CacheFactory>();
        }
    }
}
